1. Field of the Invention
The present invention relates generally to digital image scanners and more specifically to a method and system for automatically determining the brightness threshold for multiple portions of a scanned page.
2. Related Art
Digital scanners are often used to digitize document pages so the text thereon can be manipulated using a computer. For example, a scanner coupled to an optical character recognition device can be used to digitize text and put it into a format recognized by a word processing program. This allows an operator to revise or modify the document using the word processor. This process of scanning and digitizing text is often referred to as optical character recognition (OCR).
Contemporary black and white digitizing scanners typically convert a document (i.e. one or more pages of text and/or graphics) into a plurality of pixels each represented by a certain number of bits for a given resolution. The bits of each pixel refer to a graylevel of that pixel. Thus, for an eight bit format (i.e., eight bits per pixel), 256 colors (or shades of gray) can be represented for each pixel. One common format is to use four bits per pixel to represent a total range of 0 to 15, where 0 (or 15) is pure black and 15 (or 0) is pure white.
When an image is scanned and digitized, the scanner first determines the graylevel for each pixel. The graylevel is the level of brightness of that pixel. For example, for 64 shades of gray, a graylevel of 0 (digital 000000) may indicate white while a graylevel of 63 (digital 111111) indicates black. All graylevels in between these limits represent the shades of gray between black and white.
For digitizing simple text and line drawings, only two colors need to be represented. For example, the page may have simple black text on a plain white background. For such bi-level pages, only one bit per pixel is needed for the digital image to accurately represent the scanned page. In this one-bit-per-pixel format, each pixel is either black or white (which can be represented by a binary 1 or 0). Storing a digital image with only one bit per pixel is more efficient than storing the image with multiple bits per pixel.
To obtain this more efficient one-bit-per-pixel representation from the multiple-bit-per-pixel format produced by the digitizer, a threshold level must be determined. For example, scanned pixels having a graylevel below the threshold level will be set to appear as background (e.g., white), while pixels having a graylevel above threshold will be set to appear as foreground matter (e.g., black).
One technique used with conventional scanners is to have a human operator manually adjust the threshold level (sometimes called intensity or brightness) for a document to be scanned. For clean documents having dark foreground (e.g. clear text) and a light background, the threshold level is easily determined and is not critical for accurate reproduction. However, for documents having poor contrast between foreground and background or having text with very thin lines, accurate threshold determination is critical for performing OCR.
An additional problem with a manual determination and setting of the threshold level is that an operator is required to estimate the correct setting in advance and then, perhaps by trial and error, make adjustments to optimize the quality of the scanned document. This can lead to wasted time.
A further problem with this conventional solution is that the threshold is determined for the entire page being scanned. If one threshold level would be appropriate for one area of the page and a second level would be better for a second area, one portion of the page would not be of optimum quality.